package com.controller;

import com.entity.Outstorage;
import com.service.OutstorageService;
import com.until.Result;
import com.vo.Page;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author :hcy
 * @date:
 * @description:
 */
@RestController
@RequestMapping("out")
public class OutstorageController extends BaseController{
    @Resource
    private OutstorageService outstorageService;
    @PostMapping("listAllOutstorage")
    public Result listAllOutstorage(@RequestBody Page<Outstorage> page){
        return success(outstorageService.listAllOutstorage(page));
    }
    @GetMapping("getByIdOutstorage")
    public Result getByIdOutstorage(Integer outstorageId){
        return success(outstorageService.getByIdOutstorage(outstorageId));
    }
    @PostMapping("addOutstorage")
    public Result addOutstorage(@RequestBody Outstorage outstorage){
        return success(outstorageService.addOutstorage(outstorage));
    }
    @PostMapping("updateOutstorage")
    public Result updateOutstorage(@RequestBody Outstorage outstorage){
        return success(outstorageService.updateOutstorage(outstorage));
    }
    @DeleteMapping("deleteOutstorage")
    public Result deleteOutstorage(Integer outstorageId){
        return success(outstorageService.deleteOutstorage(outstorageId));
    }
}
